home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / gemfsc20 / gemfsc20.lzh / GEMFBIND / VWKSTATN.S < prev    next >
Text File  |  1993-03-26  |  4KB  |  122 lines

  1. ;*========================================================================
  2. ;* VDIFAST Public Domain VDI bindings.
  3. ;*========================================================================
  4.  
  5.  
  6. ;*************************************************************************
  7. ;* Commonly-used control functions.
  8. ;*
  9. ;*    If you use open(virtual)workstation, you'll also be using the close
  10. ;*    workstation call (you'd better be!) so they're together here.  Since
  11. ;*    close workstation only takes a vdi handle, we also throw in a couple
  12. ;*    other functions that only take a handle, since it doesn't cost but
  13. ;*    a few bytes to put them here.
  14. ;*************************************************************************
  15.  
  16. ;*------------------------------------------------------------------------
  17. ;* Open workstation.
  18. ;* Open virtual workstation.
  19. ;*------------------------------------------------------------------------
  20.  
  21.           globl     _v_opnvwk
  22. _v_opnvwk:
  23.           moveq.l    #100,d0             ;* Open vwork function = 100.
  24.           bra.b     opnwk                ;* Continue below.
  25.           globl     _v_opnwk
  26. _v_opnwk:
  27.           moveq.l    #1,d0                ;* Open work function = 1.
  28. opnwk:
  29. ;          .cargs   #8,workin.l,handle.l,workout.l
  30.  
  31. workin      =         8
  32. handle      =         12
  33. workout   =         16
  34.  
  35.  
  36.           link        a6,#0
  37.  
  38.           move.l    handle(a6),a0        ;* Handle parm is input and output,
  39.           move.w    (a0),-(sp)            ;* control[6] input handle
  40.           clr.w     -(sp)                ;* control[5] subfunction    = 0
  41.           move.w    #45,-(sp)            ;* control[4] intout count    = 45
  42.           move.w    #11,-(sp)            ;* control[3] intin  count    = 11
  43.           move.w    #6,-(sp)            ;* control[2] ptsout count    = 6
  44.           clr.w     -(sp)                ;* control[1] ptsin  count    = 0
  45.           move.w    d0,-(sp)            ;* control[0] function code
  46.  
  47.           move.l    workout(a6),a0
  48.           pea        90(a0)                ;* -> ptsout
  49.           move.l    a0,-(sp)            ;* -> intout
  50.           subq.l    #4,sp                ;* -> ptsin
  51.           move.l    workin(a6),-(sp)    ;* -> intin
  52.           pea        16(sp)                ;* -> contrl
  53.  
  54.           move.l    sp,d1
  55.           jsr        vditrap
  56.  
  57.           move.l    handle(a6),a0        ;* VDI handle must be returned
  58.           move.w    -2(a6),(a0)         ;* indirect thru user-supplied ptr.
  59.  
  60.           unlk        a6
  61.           rts
  62.  
  63. ;*------------------------------------------------------------------------
  64. ;*-----------------------------------------------------------------------
  65. ;* vwk_honly
  66. ;*    For VDI workstation calls that uses a handle only, no input or output.
  67. ;*     Entry:  d0.w = VDI function number.
  68. ;*-----------------------------------------------------------------------
  69. ;*------------------------------------------------------------------------
  70.  
  71. vwk_honly:
  72. ;          .cargs    #8,handle.w
  73.  
  74. handle      =         8
  75.  
  76.           link        a6,#0
  77. ;          VContrl    d0                    ;* Function is passed in d0.
  78.           move.w    handle(a6),-(sp)    ; contrl[6]
  79.           clr.l     -(sp)                ; contrl[5,4]
  80.           clr.l     -(sp)                ; contrl[3,2]
  81.           clr.w     -(sp)                ; contrl[1]
  82.           move.w    d0,-(sp)            ; contrl[0]
  83.  
  84.           clr.l     -(sp)                ;* (this keeps SYS_MON.PRG happy)
  85.           pea        4(sp)                ;* -> contrl
  86.           jmp        vdicall
  87.  
  88. ;*------------------------------------------------------------------------
  89. ;* Close workstation.
  90. ;* Close virtual workstation.
  91. ;*------------------------------------------------------------------------
  92.  
  93.           globl     _v_clsvwk
  94. _v_clsvwk:
  95.           moveq.l    #101,d0             ;* Close vwork function = 101.
  96.           bra        vwk_honly
  97.           globl     _v_clswk
  98. _v_clswk:
  99.           moveq.l    #2,d0                ;* Close work function = 2.
  100.           bra        vwk_honly
  101.  
  102. ;*------------------------------------------------------------------------
  103. ;* Clear workstation.
  104. ;*------------------------------------------------------------------------
  105.  
  106.           globl     _v_clrwk
  107. _v_clrwk:
  108.           moveq.l    #3,d0                ;* Clear workstation code = 3.
  109.           bra        vwk_honly
  110.  
  111. ;*------------------------------------------------------------------------
  112. ;* Update workstation.
  113. ;*------------------------------------------------------------------------
  114.  
  115.           globl     _v_updwk
  116. _v_updwk:
  117.           moveq.l    #4,d0                ;* Update workstation code = 4.
  118.           bra        vwk_honly
  119.  
  120.           end
  121.  
  122.